/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.material.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;

import java.util.Objects;

/**
 * 考试学员表 实体类
 *
 * @author junxin
 * @since 2023-05-04
 */
@Data
@TableName("ts_release_exam_user")
@ApiModel(value = "releaseExamUser对象", description = "考试学员表")
@EqualsAndHashCode(callSuper = true)
public class ReleaseExamUserEntity extends TenantEntity {
	/**
	 * 乐观锁
	 */
	@ApiModelProperty(value = "乐观锁")
	private String revision;
	/**
	 * 班级id
	 */
	@ApiModelProperty(value = "发布id")
	private Long releaseId;
	/**
	 * blade_user_id
	 */
	@ApiModelProperty(value = "blade_user_id")
	private Long userId;
	/**
	 * 版本批次号
	 */
	@ApiModelProperty(value = "版本批次号")
	private String version;
	/**
	 * 考试授权(1 是 默认、0 否 待授权 )
	 * 如果是1 可以正常考试  已授权
	 * 如果是0 不能进入考试  待授权
	 */
	@ApiModelProperty(value = "考试授权")
	private Integer permit;


	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (!(o instanceof ReleaseExamUserEntity)) return false;
		if (!super.equals(o)) return false;
		ReleaseExamUserEntity entity = (ReleaseExamUserEntity) o;
		return releaseId.equals(entity.releaseId) &&
			userId.equals(entity.userId);
	}

	@Override
	public int hashCode() {
		return Objects.hash(super.hashCode(), releaseId, userId);
	}
}
